import XBCIM from 'xbcim'
export default{
	computed: {
		isSenderThemselve(){
			const userId = XBCIM.getUserId()
			return this.message?.senderId == userId
		},
		userName(){
			const cpages = getCurrentPages()
			const croute = cpages[cpages.length - 1]?.route
			return this.isSenderThemselve || croute.includes('pages/chat/single') ? '' : this.message?.senderName
		},
		userAvatar(){
			return this.isSenderThemselve ? this.message?.senderAvatar : this.message?.receiverAvatar
		},
		isRead(){
			return this.message?.isRead
		},
		messageContent(){
			return JSON.parse(this.message?.content || '{}')
		}
	},
}